package huoye.shops.huoye.mine.presenter;


import android.os.CountDownTimer;
import android.util.Log;

import com.codeideology.android.rpc.BaseJsonRequestCallback;
import com.codeideology.android.utils.StringUtils;

import huoye.shops.MainActivity;
import huoye.shops.R;
import huoye.shops.base.BasePresenter;
import huoye.shops.base.MineBaseJsonRequestCallback;
import huoye.shops.base.UserManager;
import huoye.shops.huoye.mine.model.ShopDetials;
import huoye.shops.huoye.mine.networt.MineService;
import huoye.shops.huoye.mine.view.IShopMessageView;
import huoye.shops.huoye.user.model.UpdateInfo;
import huoye.shops.huoye.user.model.User;
import huoye.shops.huoye.user.network.UserService;
import huoye.shops.huoye.user.view.ILoginView;


/**
 * Created by uesr on 2017/7/19.
 */

public class ShopMessagePresenter extends BasePresenter<IShopMessageView> {


    private MineService mService;

    //管理后台店铺详情
    public void getShopDetials(){
        mService.getShopDetials( new MineBaseJsonRequestCallback<ShopDetials>(ShopDetials.class) {

            @Override
            public void onSuccess(ShopDetials shopDetials) {
                super.onSuccess(shopDetials);
                view.setShopMessage(shopDetials);

            }

            //网络请求失败
            @Override
            public void onFailure(String msg, String code, Throwable e) {
                super.onFailure(msg, code, e);
                view.makeToast(msg);

            }

            //加载结束
            @Override
            public void onNetworkFail() {
                super.onNetworkFail();
                view.onNetworkFail();
                Log.e("test","3");
            }

            //加载中
            @Override
            public void onFinish() {
                super.onFinish();
                view.hideProcessingIndicator();
                Log.e("test","4");
            }
        });
    }


    @Override
    public void onStart() {
        mService = new MineService();
    }
}
